
/*
规则定义
 */
const mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');
var schema = new mongoose.Schema({ 
    title:String,
    brief:String,
    author:String,
    source:String,
    desc:String,
    date:{type:Date,default:Date.now},
    cateId:mongoose.Schema.ObjectId,
    newsId:mongoose.Schema.ObjectId
});

schema.plugin(mongoosePaginate);
module.exports  = mongoose.model('News',  schema,'news'); // Model.paginate()